Subdividing rotation in a character using quaternion interpolation for modeling and animation in three dimensions

ABSTRACT

Subdividing rotation between two poses in three dimensions may be accomplished in three parts. First, data defining the two poses is obtained from the animation or modeling interface. Second, a path associated with the two poses is determined. Third, using quaternion interpolation, the roll between the two poses is interpolated at intermediate positions along the path. The amount of roll at each of these intermediate positions then may be applied to three dimensional structures used for character rigging.

CROSS REFERENCE TO RELATED APPLICATION

This patent application claims the benefit, under 35 U.S.C. §120, of,and is a continuation of, U.S. Ser. No. 10/216,402, filed on Aug. 9,2002, pending, which is incorporated herein by reference.

BACKGROUND

In three-dimensional modeling and animation, characters typically have askeletal structure in which elements may be rotated or rolled. Suchcharacters may include humanoid, animal or imaginary characters. Theseskeletal structures include, but are not limited to, spines, necks andother appendages that rotate, such as arms, legs or tails. In thesestructures, it is often desirable to have the rotation or rolldistributed or divided over the elements to realistically simulatemotion and poses. As a result, roll division presents a fundamentalproblem in three dimensional character setup and animation for almostall characters.

These skeletal structures typically are approximated using a set ofobjects that are manipulated using inverse or forward kinematics. Such astructure typically is created using a representation of a skeleton thatincludes a hierarchy of objects. In such a hierarchy of objects, amanipulation applied to an element is applied to other elements that arebelow it in the hierarchy. For example, an animation on a spinetypically involves manipulating individual vertebra, and any rotation ofone vertebra automatically is applied to other vertebrae that areconnected to it.

For example, referring to FIGS. 1A-1C, a skeleton with a spine 100defined by a hierarchy of vertebra 102 is shown. In particular, FIG. 1Ashows a character with a straight spine. In this example, the hierarchyof vertebra 102 is defined upwards, meaning a change in one vertebracauses a change in the vertebra above it. If ten degrees of rotation isadded to the bottom vertebra 104, as shown in FIG. 1B, then all thevertebra above it then have the same rotation and are at a ten degreeangle. If another ten degrees of rotation is added to the fourthvertebra 106, as shown in FIG. 1C, then all the vertebra above thefourth vertebra have this additional ten degrees of rotation and are nowat a twenty degree angle.

If the animator decided to move the bottom vertebra 104 to a certainorientation and leave the end of the spine 108 where it is in FIG. 1C,then the animator would have to counter-animate the end of the spine108. That is, the animator would first place the bottom vertebra 104 ata desired position, and then would reposition the other spine elementsabove until the end of the spine 108 was in the same position as in FIG.1C. This process of counter-animation wastes a significant amount oftime while animating or posing a character, especially when fineadjustments are repeatedly made to the lower body, which then entailssimilar fine counter-animation to the upper body.

A parallel problem, called pinching, may occur when an appendage, suchas an arm, is rotated. An example of pinching is shown in FIGS. 2A-2E,which illustrates rotation of a cube. As the corner 202 and face 200 arerotated from the orientation in FIGS. 2A to the orientation shown inFIG. 2E, the face 204, for example, is pinched inwards. This same kindof pinching occurs in three-dimensionally animated characters that haverotating parts, such as arms and legs, which often requires correctivesteps to be taken to modify the form or shape of the rotating part.

SUMMARY

These problems are solved by subdividing rotation using quaternioninterpolation. Subdividing rotation between two poses in threedimensions may be accomplished in three parts. First, data defining thetwo poses is obtained from the animation or modeling interface. Second,a path associated with the two poses is determined. Third, usingquaternion interpolation, the roll between the two poses is interpolatedat intermediate positions along the path. The amount of roll at each ofthese intermediate positions then may be applied to three dimensionalstructures used for character rigging.

In one embodiment, a skeletal structure of a three-dimensional characterthat includes interconnected elements that rotate is defined by twocontrol objects and one or more interconnected elements between them.The control objects may represent, for example, a structure in the lowerbody such as the hips and a structure in the upper body such as thechest. The interconnected elements between them may represent, forexample, vertebrae of the spine. Each control object has a pose that isdefined by a position and orientation in three-dimensional space. Theorientation is defined by a direction and a roll around that direction.A path is defined between the poses of the two control objects. One ormore additional control parameters may define the form, nature oralgorithm of the path. The interconnected elements, e.g., vertebrae, arepositioned along the path. The direction of each element is determinedby the tangent to the path at the position of the element along thepath. The roll of each element is determined using quaternioninterpolation between the rotation of the first control object and therotation of the second control object.

In another embodiment, to avoid the pinching problem, as in FIGS. 2A-2E,quaternion interpolation is used to subdivide rotation on an envelope,muscle or skin or other structure being driven by a controllingstructure. This embodiment is particularly useful for modeling andanimating structures such as arms, legs, tails, and other appendagesthat may rotate.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A-1C illustrate a hierarchy of objects in a character.

FIGS. 2A-2E illustrate a problem of shearing in a rotated object.

FIG. 3 is a descriptive illustration of a spine or other similarskeletal structure.

FIGS. 4A-4B graphically illustrate an example of how position, directionand rotation of elements may be determined.

FIG. 5 is a data flow diagram illustrating an example of how position,direction and rotation of elements may be determined.

FIG. 6 is a descriptive illustration of several poses of a spine thatmay be produced in modeling or in an animation.

FIG. 7 graphically illustrates how counteranimation may be reduced.

FIGS. 8A-8C graphically illustrate forearm roll.

FIGS. 9A-9B graphically illustrate bicep roll.

FIG. 10 is a flowchart describing how rotation may be distributed overset of interconnected elements using quaternion interpolation.

DETAILED DESCRIPTION

Referring to FIG. 3, a spine or other similar skeletal structure of acharacter may be defined using a combination of one or more elements 300along a path 302 between a first control object 304 and a second controlobject 306. Each control object has a position (308, 310) and anorientation in three-dimensional space. The orientation is described asa direction (312, 314) and a roll (316, 318) around that direction.Similarly, each element 300 has a position and an orientation. For aspine, the first control object may correspond to a structure in thelower body, such as the hip. The second control object may correspond toa structure in the upper body, such as a chest or ribcage.

The path 302 is derived from two vectors corresponding to theorientations of the control objects. These two vectors may be used todefine a curve, for example, a Bezier curve or a NURBS curve, inthree-dimensional space. Control points representing these two vectors,and optionally additional control points of the curve, may be displayedthrough a user interface and may be manipulated or animated orcontrolled through an algorithm to modify the shape of the curve.

Referring now to FIGS. 4A-4C, how the position and orientation of eachelement is determined will now be explained. The position of eachelement on the path, shown in FIG. 4A is determined by defining the pathand dividing the path into a number of segments 400 corresponding to thenumber of elements. The direction each element, shown in FIG. 4B, isdefined by the tangent 402 to the path at the position of the elementalong the path. The roll 404 of each element, shown in FIG. 4C, isdetermined using quaternion interpolation between the orientations ofthe control objects. The result of quaternion interpolation is mapped toa vector in three-dimensional space. The roll of the element is set tobe aligned with this vector. The result of applying this operation oneach element is incremented roll division along the path between thecontrol objects.

FIG. 5 is a data flow diagram describing how the pose of each element300 (FIG. 3) may be determined. The pose 500 of the first control objectand the pose 502 of the second control object are used by a pathgenerator 504 to generate a defined path 506. For example, the pathgenerator 504 may use the poses 500 and 502 to derive two vectors tospecify a curve, for example a Bezier curve or NURBS curve, inthree-dimensions. An element positioning module 508 uses the definedpath and specifications 510 of the elements to determine the positionand direction 512 of each element. The position of each element may bedetermined, for example, by uniformly dividing the path by the number ofelements or by using a fixed distance between elements along the path orby some other method, as noted in connection with FIG. 4A. The directionfor each element is determined by the tangent to the path at theposition determined for the element along the path, as noted inconnection with FIG. 4B. The defined path 506 and the poses 500 and 502of the control objects are used by quaternion interpolator 514 todetermine a value from which the rotation 516 of each element isdetermined, as described above in connection with FIG. 4C. The positionand direction 512 and the rotation 516 of each element define the poseof each element between the first and second control objects.

The interpolation used to determine the rotation of each element may bea form of quaternion interpolation. Conventional quaternioninterpolation is described, for example, in “Quaternions, Interpolationand Animation,” by Erik Dam, Martin Koch and Martin Lillholm, TechnicalReport DIKU-TR-98/5, from University of Copenhagen, Department ofComputer Science. Linear interpolation between quaternions, sphericallinear interpolation (slerp) between quaternions, spherical splineinterpolation between quaternions, and variations on these techniquesmay be used. Useful variations include those that minimize thetangential curvature using gradient descent.

In one example, using conventional spherical linear interpolation ofquaternions, two paths from one orientation to another are determinedalong the surface of a hypersphere, and the shortest path is selected.Thus the maximum amount of rotation that can be computed is limited to180 degrees in any direction on the surface of the hypersphere. Thatmeans, for example, that an amount of rotation that might be consideredto be 220 degrees would be discarded in favor of the 140 degree path inthe opposite direction. This limitation is enforced in a conventionalimplementation of spherical linear interpolation by computing the crossproduct between two quaternions. This cross product is used in theremainder of the interpolation calculations. If the cross product isnegative, it is first inverted before it is used in the remainder of theinterpolation calculations. A scaling value that is generated from theinterpolation calculations also is inverted. Linear interpolation may beused if the quaternions are close together, for example, if their crossproduct is determined to be close to 1.0.

A number of strategies can be employed to increase range of rotationthat can be achieved. For example, the shortest path decision can beeliminated from a conventional implementation of spherical linearinterpolation. This decision is eliminated by removing the test forwhether the computed cross product is negative, and by removing therelated inversion operations. As a result, a range of 360 degrees ineither direction can be achieved.

For either modeling or animation, the poses of the first and secondcontrol objects can be modified as shown in FIG. 6. In FIG. 6, eachdifferent pose 606-624 of the first and second control objects 600 and602 results in different poses of the elements 604 between them. Usingthe techniques described above, a modeling tool may automaticallygenerate the poses of the interconnected elements during setup of thecharacter based on the positions of the control objects, or an animationtool may automatically generate the poses of the interconnected elementsduring an animation according to the poses of the control objects. Theposes of the control objects can be animated using key frames, riggingtechniques, an algorithm and other techniques. The different images inFIG. 6 may represent different poses displayed by a modeler or differentorientations of the structure over time in an animation.

Counter-animation is reduced by using these techniques because the posesof the interconnected elements, e.g., the vertebrae, are driven by theposes of the control objects, e.g, the hip and chest. For example, asshown in FIG. 7, the lower body structure 700 can be rotated (incomparison to FIG. 1C), without causing any movement to the upper bodystructure 702. The vertebrae 704 between the lower body structure 700and the upper body structure 702 are automatically reassigned anappropriate roll using the techniques described above.

Because this example system can be dynamically proportioned to differentsizes, it therefore becomes feasible to create standard skeletalstructures for different types of characters. These dynamic skeletalstructures may be used to transfer animation and attributes betweendifferent skeletal structures and as templates in a modeling system.

One problem that may arise, particularly during keyframed animation, isthat the poses of the first and second control objects might cause thechain of elements to be stretched or compressed. Many strategies may beemployed to solve this problem. For example, the path could be definedas a fixed length from one of the control objects where the othercontrol object is free. Alternatively, the range of one of the controlobjects may be limited to the length of the path away from the othercontrol object. Alternatively, the path length may be controlled usingvarious interfaces and/or algorithms.

The foregoing examples illustrate a spine. The forearm, upper arm,thigh, and other appendages of characters, have similar problems ofdividing roll. In these examples, the divided roll is applied to otherstructures describing the mass of the character, such as an envelope,muscles, skin or other objects. Quaternion interpolation can be used tosubdivide the rotation along such appendages in a manner parallel to theexample of the spine provide above.

Referring to FIGS. 8A-8C, an example based on roll of a forearm will nowbe described. In particular, an arm 800 having a bicep bone 802, aforearm bone 804 and a hand bone 806 is shown. The rotation of the handis controlled by a hand controller roll input 808. The shapes 803, 805and 807, for example, are merely icons, typically called chains incomputer graphics, and do not represent the shape of the bones inthree-dimensional space. Each bone is typically modeled as a straightline (or cylinder) having a position and direction and an associatedrotation. FIG. 8A shows a forearm with no rotation. In FIG. 8B, aforearm controller is manipulated to rotate the forearm bone 804 asshown at 810, which in turn rotates the hand bone 806. This roll affectsthe forearm by affecting any structures, such as an envelope, skin ormuscle, associated with the forearm bone 804. For example, any skinshould twist from one end of the forearm 812 to the other end of theforearm 814. The rotation along the forearm bone from the bicep bone tothe hand bone is subdivided using quaternion interpolation as indicatedby the arrows 816 and 818. Further movement of the hand bone 806, asshown at 820 in FIG. 8C, causes a further rotation to be associated withthe forearm, as indicated by the arrows at 822 and 824.

Similarly, an example of roll of a bicep of an arm is illustrated inFIGS. 9A-9B. In particular, an arm 900 having a bicep bone 902, aforearm bone 904 and hand bone 906 is shown. The position andorientation of the bicep bone 902 affects the orientation of the forearmbone 904 and everything below it. FIG. 9A illustrates the bicep bonewithout any rotation. In FIG. 9B, the bicep bone 902 has been rotated908 to a new position. The rotation of the bicep affects any structures,such as an envelope, skin or muscle, associated with the bicep. Forexample, any skin should twist from one end 910 of the bicep to theother end 912. The rotation along the bicep bone from the shoulder (notshown) to the forearm bone is subdivided using quaternion interpolationas indicated by the arrows 914 and 916.

It will now be described in more detail how quaternion interpolation maybe used to subdivide rotation associated with such appendages, or othersimilar structures, will now be described in more detail.

FIGS. 10 and 11 are flow charts describing examples of how rotation maybe subdivided along an object that is defined in a hierarchy of objects.The process of FIG. 10 would be used to subdivide rotation along anobject such as a bicep, thigh or other similar skeletal structure. Forexample, this process could be used for the first bone of an appendage.The process of FIG. 11 would be used to subdivide rotation along anobject such as a forearm or lower leg or other similar structure. Forexample , this process could be used for the second bone of anappendage. In both of these examples, two poses in three dimensions areidentified. The first pose is associated with one end of the object andthe second pose is associated with the other end of the object. Usingquaternion interpolation between the first pose and the second pose, anamount of roll is determined at intermediate positions along the object.The amount of roll determined for each intermediate position along theobject then may be applied to structures driven by the object.

Referring now to FIG. 10, a first rotation value is the current rotationof the object, as indicated at 1000. A second rotation value, an“unspun” rotation value, for the object is determined in 1002. Theunspun rotation is the minimum rotation that the object could have if itwere rotated towards its current direction from the pose of its parentobject. Quaternion interpolation, as described above, is then used in1004 to interpolate, for intermediate positions along the object,between the unspun rotation value and the actual rotation of the objectto determine the subdivide roll. The subdivided roll then may be applied1006 to the structures, such as an envelope, skin, muscle or otherstructure, associated with the object.

Referring now to FIG. 11, an unspun rotation value for the object isdetermined in 1100, in the same manner as described above. A secondrotation value, called a “straightened” rotation value, is then computedin 1102. The straightened rotation value is the rotation that the nextcontrol object in the appendage would have if this next object wererotated to match the direction of the current object, but maintainingits roll. Quaternion interpolation, as described above, is then used in1104 to interpolate, for intermediate positions along the object,between the unspun rotation value and the straightened rotation value todetermine the subdivided roll. The subdivided roll then may be applied1106 to structures, such as an envelope, skin, muscle or otherstructure, associated with the object.

It is also advantageous using these techniques to combine multiple spinesystems or arms systems together to allow animation and modeling of longappendages with multiple controllers. Such a combination of systemscould be used, for example, to model and animate a snake like characteror a character with a long neck or tail.

Having now described an example embodiment, it should be apparent tothose skilled in the art that the foregoing is merely illustrative andnot limiting, having been presented by way of example only. Numerousmodifications and other embodiments are within the scope of one ofordinary skill in the art and are contemplated as falling within thescope of the invention.

1. An apparatus for subdividing rotation, comprising: means forreceiving data defining a first pose and a second pose in threedimensions; means for determining a. path associated with the first poseand the second pose; means for determining an amount of roll atintermediate positions along the path using quaternion interpolationbetween the two poses; and means for applying the determined amount ofroll at the intermediate positions along the path to three dimensionalstructures associated with the intermediate positions.
 2. A method forsubdividing rotation, comprising: receiving data defining a first poseand a second pose in three dimensions; determining a path associatedwith the first pose and the second pose; determining an amount of rollat intermediate positions along the path using quaternion interpolationbetween the two poses; and applying the determined amount of roll at theintermediate positions along the path to three dimensional structuresassociated with the intermediate positions.
 3. A computer programproduct comprising: a computer readable medium; computer programinstructions stored on the computer readable medium that, when executedby a computer, cause the computer to perform a method for subdividingrotation, comprising: receiving data defining a first pose and a secondpose in three dimensions; determining a path associated with the firstpose and the second pose; determining an amount of roll at intermediatepositions along the path using quaternion interpolation between the twoposes; and applying the determined amount of roll at the intermediatepositions along the path to three dimensional structures associated withthe intermediate positions.